package com.example.pojo.pojoenum;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.jdbc.Null;

@AllArgsConstructor
@Getter
@Slf4j
public enum Position {
    MAIN_TEACHER(1,"主班教师"),
    VICE_TEACHER(2,"副班教师"),
    CAREGIVER(3,"保育员"),
    PRINCIPAL(4,"园长"),
    OTHER(5,"其他");

    public static Position getEnum(String name) {
        for (Position item : values()) {
            if (item.getValue().equals(name)) {
                return item;
            }
        }
        return null;
    }

    @EnumValue
    private final int code;
    @JsonValue
    private final String value;
}